import {createRouter, createWebHashHistory} from "vue-router"
import CreateTable from "@/views/home/CreateTable.vue";
import ConfigMapping from "@/views/config/ConfigMapping.vue";
import ConfigDatabase from "@/views/config/ConfigDatabase.vue";
import ConfigLanguage from "@/views/config/ConfigLanguage.vue";
import Account from "@/views/account/Account.vue";
import Setting from "@/views/setting/Setting.vue";
import MultiTemplate from "@/views/template/MultiTemplate.vue";
import ConfigTemplate from "@/views/config/ConfigTemplate.vue";

const routes = [
  { path: '/'         , component: MultiTemplate},
  { path: '/template' , component: MultiTemplate},
  { path: '/table'   , component: CreateTable},
  { path: '/account' , component: Account},
  { path: '/setting' , component: Setting},

  // 配置信息
  { path: '/config/mapping' , component: ConfigMapping},
  { path: '/config/database', component: ConfigDatabase},
  { path: '/config/language', component: ConfigLanguage},
  { path: '/config/template', component: ConfigTemplate},

  // 其余所有路由
  { path: '/:pathMatch(.*)*', redirect: '/' },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export default router